package com.yubest.designpattern.behavior.command;

import lombok.AllArgsConstructor;

/**
 * 遥控器
 *
 * @Author: hweiyu
 * @Date: 2022/10/26 16:54
 */
@AllArgsConstructor
public class Invoker {

    private Command on;

    private Command off;

    /**
     * 开灯
     */
    public void turnOn() {
        on.exec();
    }

    /**
     * 关灯
     */
    public void turnOff() {
        off.exec();
    }
}
